package FastJosnTest.UserToJson;

import com.alibaba.fastjson.JSON;

import java.io.*;

public class ObjectToJson {
    public static void main(String[] args) throws Exception {
        Writer writer = new OutputStreamWriter(new FileOutputStream("D:\\MP\\json\\User.json"));
        BufferedReader reader = new BufferedReader(new FileReader("D:\\MP\\data_sum_days\\input\\t_alibaba_data3.txt"));
        String line;
        User user = new User();
        while ((line = reader.readLine()) != null) {
            String[] datas = line.split("\t");
            user.set(datas[0], Integer.parseInt(datas[1]), Integer.parseInt(datas[2]), datas[3]);
            String json = JSON.toJSONString(user);
            writer.write(json);
            writer.write("\n");
        }
        reader.close();
        writer.close();
    }
}
